#ifndef __BALLADE_DISPATCHER_H__
#define __BALLADE_DISPATCHER_H__

#pragma once
#pragma warning(disable: 4786)

#include <map>
#include <string>

#include <ballade/smartclient/listener.h>

namespace Ballade
{
	namespace SmartClient
	{
		using std::string;
		using std::map;

		class Dispatcher
		{
		public:
			~Dispatcher();

			void registerListener(const Listener *listener);
			void removeListener(const string &name);
			void dispatch(const string &name, const char *data);

		private:
			map<const string, Listener *> _listeners;
		};
	}
}
#endif